<?php

namespace app\index\controller\my;

use app\index\model\UM as UM;
use ShidianUtil\Thinkphp\Response\ApiResponse;
use think\APP;

/**
 * 微信公众号
 * Class Subscription
 * @package app\index\controller\wechat
 */
class SubscriptionInfo
{

    /**
     * @url /my/subscription_info/read
     * @return mixed|string|\think\response\Xml
     */
    public function read(?UM $user): ApiResponse
    {
        $followed = '0';

        if ($user) {

            $followed = $user->followedWechat;
        }

        return ApiResponse::success([
            'followed' => $followed,
        ]);
    }
}
